package com.itheima.manager.service.imp;

import com.itheima.manager.mapper.UserMapper;
import com.itheima.manager.pojo.User;
import com.itheima.manager.service.ILoginService;
import com.itheima.manager.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

public class LoginServiceImp implements ILoginService {
    @Override
    public User login(String username, String password) {

        SqlSession session = SqlSessionUtil.getSession();

        UserMapper mapper = session.getMapper(UserMapper.class);

        User user = mapper.selectLogin(username, password);

        return user;

    }
}
